/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Nothing4ever
 */
@Entity
@Table(name = "Enroll")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Enroll.findAll", query = "SELECT e FROM Enroll e"),
    @NamedQuery(name = "Enroll.findById", query = "SELECT e FROM Enroll e WHERE e.id = :id"),
    @NamedQuery(name = "Enroll.findByStatus", query = "SELECT e FROM Enroll e WHERE e.status = :status"),
    @NamedQuery(name = "Enroll.findByReason", query = "SELECT e FROM Enroll e WHERE e.reason = :reason"),
    @NamedQuery(name = "Enroll.findByIntroduction", query = "SELECT e FROM Enroll e WHERE e.introduction = :introduction"),
    @NamedQuery(name = "Enroll.findByCreatedDate", query = "SELECT e FROM Enroll e WHERE e.createdDate = :createdDate"),
    @NamedQuery(name = "Enroll.findByPaymentOption", query = "SELECT e FROM Enroll e WHERE e.paymentOption = :paymentOption"),
    @NamedQuery(name = "Enroll.findByPresentationFile", query = "SELECT e FROM Enroll e WHERE e.presentationFile = :presentationFile")})
public class Enroll implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    //@NotNull
    @Column(name = "Id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @Column(name = "Status")
    private Integer status;
    @Size(max = 2000)
    @Column(name = "Reason")
    private String reason;
    @Size(max = 2000)
    @Column(name = "Introduction")
    private String introduction;
    @Column(name = "Created_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdDate;
    @Column(name = "Payment_Option")
    private Integer paymentOption;
    @Size(max = 1000)
    @Column(name = "Presentation_File")
    private String presentationFile;
    @JoinColumn(name = "Account_Id", referencedColumnName = "Id")
    @ManyToOne
    private Account accountId;
    @JoinColumn(name = "Event_Id", referencedColumnName = "Id")
    @ManyToOne
    private Event eventId;

    public Enroll() {
    }

    public Enroll(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Integer getPaymentOption() {
        return paymentOption;
    }

    public void setPaymentOption(Integer paymentOption) {
        this.paymentOption = paymentOption;
    }

    public String getPresentationFile() {
        return presentationFile;
    }

    public void setPresentationFile(String presentationFile) {
        this.presentationFile = presentationFile;
    }

    public Account getAccountId() {
        return accountId;
    }

    public void setAccountId(Account accountId) {
        this.accountId = accountId;
    }

    public Event getEventId() {
        return eventId;
    }

    public void setEventId(Event eventId) {
        this.eventId = eventId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Enroll)) {
            return false;
        }
        Enroll other = (Enroll) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.entity.Enroll[ id=" + id + " ]";
    }
    
}
